﻿using System.Collections.Generic;
using System.Linq;

namespace ZQNB.Entity.UI
{
    public class Layout
    {
        public virtual LayoutFile LayoutFile { get; set; }
        public virtual IList<Row> Rows { get; set; }
        public virtual void AddRow(Row row)
        {
            row.ItemOrder = Rows.Count == 0
                ? 0
                : Rows.OrderByDescending(x => x.ItemOrder).Select(x => x.ItemOrder).FirstOrDefault() + 1;
            Rows.Add(row);
        }
    }
}